package cn.toutatis.common.config;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @author Toutatis_Gc
 */
public enum  TimeConstant {

    /**
     * 单例模式
     */
    INSTANCE;

    public String DATE_FORMAT_REGEX = "yyyy-MM-dd HH:mm:ss";

    public SimpleDateFormat simpleDateFormat = new SimpleDateFormat(DATE_FORMAT_REGEX);

    public String getCurrentTime(){
        return simpleDateFormat.format(new Date());
    }

    public String getCurrentTimeByLong(long time){
        return simpleDateFormat.format(new Date(time));
    }

}
